const STATUS = {
  success: 200,
  fail: 403,
  auth: 401,
};

class BaseAdapter {
  code;
  message;
  data;

  constructor({ code, message, data }) {
    this.code = code;
    this.message = message;
    this.data = data;
  }
}

class SuccessModel extends BaseAdapter {
  constructor(message, { code = STATUS.success, data = [] }) {
    super({ code: code, message, data });
  }
}

class FailModel extends BaseAdapter {
  constructor(message, { code = STATUS.fail, data = [] }) {
    super({ code: code, message, data });
  }
}

module.exports = {
  STATUS,
  SuccessModel,
  FailModel,
};
